<template>
  <div class="excelFile">
    <vue-office-excel :src="fileUrl" />
  </div>
</template>

<script>
import VueOfficeExcel from "@vue-office/excel";
import base from "@/utils/http/base"; // 导入接口域名列表

export default {
  components: { VueOfficeExcel },
  props: {
    info: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      //   pdf: "http://10.1.79.98:8080/static/pdf.pdf", //设置文档地址
    };
  },
  computed: {
    fileUrl() {
      return `${base.url}/knowledge_base${
        this.info.file_url.split("/knowledge_base")[1]
      }`;
    },
  },
};
</script>
<style lang="scss" scoped>
.excelFile {
  width: 100%;
  height: calc(100% - 40px);
  overflow: auto;
  ::v-deep .vue-office-excel {
    width: 2920px;
    height: 1920px;
    .x-spreadsheet-scrollbar {
      display: none !important;
    }
    .x-spreadsheet-overlayer-content {
      display: none !important;
    }
    .x-spreadsheet-overlayer {
      display: none !important;
    }
    .x-spreadsheet-menu {
      display: flex;
      :nth-child(1) {
        display: none;
      }
      > li {
        margin: 10px 20px;
        margin-left: 0px;
        padding: 3px 5px;
        border: 1px solid #ccc;
      }
    }
  }
}
</style>
